<?php
class Configure {
    /**
     * app source code path
     * @var string
     */
	protected $_loadPath = NULL;
	/**
	 * constructor
	 */ 
	public function __construct() { 		

	    $_app  = $this->getLoadPath();
		$_base = APP_PATH.$_app.DS;
		$_path = $_base.FOLDER_CTL.DS;
		$_view_path = $_base.FOLDER_TPL.DS;
		
		if (!($_comp_path = SiteConfig::loadTemplateCompilePath())) {//development env
		    $_comp_path = $_base.FOLDER_TPC.DS;
		    Set::recursiveMkdir($_comp_path);
		}		

		define('CTL_PATH',$_path);
		define('TPL_PATH',$_view_path);
		define('TPC_PATH',$_comp_path);
	}
	/**
	 * set the source code path
	 * @param string $path
	 */
	public function setLoadPath($path) {
		!empty($path) && $this->_loadPath = $path;	
	}
	/**
	 * get the source code path
	 * @return string
	 */
	public function getLoadPath() {
	    $this->_loadPath = SiteConfig::loadPath();
		return $this->_loadPath;
	}
}
?>